const db = require('./index');

module.exports = {
    findCollect: async (user_id, product_id) => {
        const sql = ` select * from collect where user_id = ? and product_id = ? `;
        return await db.query(sql, [user_id, product_id])
    },
    addCollect: async (user_id, product_id, timeTemp) => {
        const sql = ` insert into collect values (null,?,?,?) `;
        return await db.query(sql, [user_id, product_id, timeTemp])
    },
    getCollect: async (user_id) => {
        const sql = ` select * from collect where user_id = ? `;
        return await db.query(sql, user_id)
    }
}